package org.gruposp2p.proyectokarma.service

import org.gruposp2p.proyectokarma.domain.Peer;

class MailSenderService implements org.gruposp2p.proyectokarma.util.MailSenderService {
	
	boolean transactional = false
	def mailService;
	def backgroundService
	//def bgThreadManager
	
	public void sendMail (Peer peer, String url, String mailSubject, String bodyView) {
		 // bgThreadManager.queueRunnable(new MyRunnable())
		def sendMail = backgroundService.execute("- Sending mail -" + mailSubject + "- to peer:${peer.email}", 
			{mailService.sendMail {
				to peer.email
				subject mailSubject
				body(view:bodyView, model:[peer:peer, url:url])
			}})
	}
	
}
